package hn.cch.message;

public class Response<T> {

    public final static String SUCCESS = "success";
    public final static String FAILURE = "failure";

    private String code;
    private T info;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public T getInfo() {
        return info;
    }

    public void setInfo(T info) {
        this.info = info;
    }


    public static Response success(){
        Response response = new Response();
        response.setCode(SUCCESS);
        return response;
    }

    public static Response failure(){
        Response response = new Response();
        response.setCode(FAILURE);
        return response;
    }
}
